import sys

from customClean import customClean
from printInfo import printInfo
from startCleaning import startCleaning
from systemSleep import startSleep,closeSleep
from printSelect import printSelect

#引入pyinstaller打包模块
import _

def selectNumbers():
    while True:
        def case1():
            startCleaning()
            printSelect()
            return

        def case2():
            sys.exit()
            return

        def case3():
            closeSleep()  #系统是否开启休眠cmd窗口使用这个powercfg /a命令查看
            printSelect()
            return

        def case4():
            startSleep()  #系统是否开启休眠cmd窗口使用这个powercfg /a命令查看
            printSelect()
            return

        def case5():
            customClean()  #自定义清理
            printSelect()
            return

        def default():
            print("输入错误请重新输入")
            printSelect()
            return

        def switch(target):
            switch_case = {
                #case1后边不能加小括号
                1: case1,
                2: case2,
                3: case3,
                4: case4,
                5: case5,
            }
            return switch_case.get(target, default)()

        target = input(
            "请检查" + '"需要清理的文件夹列表.txt"' + "内的文件路径是否正确，并且重要数据已经备份！！！" + "然后输入数字键+回车键继续执行程序")
        # print(type(target))
        target = int(target)
        switch(target)


if __name__ == '__main__':
    #打印程序信息
    printInfo()
    #打印选项
    printSelect()
    #选择数字
    selectNumbers()
